import { _decorator, Component, Label, Node, tween } from 'cc';
import { BasicUI } from '../../Init/Basic/BasicUI';
const { ccclass, property } = _decorator;
export interface ToastUIData {
    tip: string;
}
@ccclass('ToastUI')
export class ToastUI extends BasicUI {
    @property(Label)
    protected tipLabel: Label = null;

    public show(d: ToastUIData) {
        this.tipLabel.string = d.tip;
        this._cut = 0;
        super.show(d);
        console.log("ToastUI show" + this.node.active);
    }
    private _cd = 2;
    private _cut = 0;
    protected update(dt) {
        if (this.node.active) {
            this._cut += dt;
            if (this._cut >= this._cd) {
                this._cut = 0;
                this.hide();
            }
        }
    }
    public hide() {
        super.hide();
    }
}

